<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.8.16" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>LEAF: basic-oscillators.c</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <script type="text/javascript" src="../js/iframeResizer.contentWindow.min.js"></script>
    <!-- <script src="/js/template.js"></script> -->
     <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script> 
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
    <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
    <!-- <link rel="stylesheet" href="/css/tachyons.css" type="text/css" /> -->
</head>
<body class="bg-washed-green black-70 ph0 sans-serif" onload="iframeResizePipe()">
    <div>
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part -->
    </div>
</body>
</html><!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">basic-oscillators.c</div>  </div>
</div><!--header-->
<div class="contents">
<p>Header. </p><div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment">  ==============================================================================</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">    basic-oscillators.h</span></div>
<div class="line"><span class="comment">    Created: 5 Mar 2020 2:56:24pm</span></div>
<div class="line"><span class="comment">    Author:  Matthew Wang</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  ==============================================================================</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;../leaf/leaf.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">char</span> mempool[1000];</div>
<div class="line">tCycle cycle;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span>    exampleInit(<span class="keywordtype">void</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span>    exampleFrame(<span class="keywordtype">void</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span>   exampleTick(<span class="keywordtype">float</span> sampleIn);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span>   exampleRandom(<span class="keywordtype">void</span>);</div>
</div><!-- fragment --><p>An example.</p>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment">  ==============================================================================</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">    basic-oscillators.c</span></div>
<div class="line"><span class="comment">    Created: 5 Mar 2020 2:56:24pm</span></div>
<div class="line"><span class="comment">    Author:  Matthew Wang</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  ==============================================================================</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;basic-oscillators.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> exampleInit()</div>
<div class="line">{</div>
<div class="line">    <a name="_a0"></a><a class="code" href="struct_l_e_a_f.html">LEAF</a> leaf;</div>
<div class="line">    </div>
<div class="line">    <a name="a1"></a><a class="code" href="group__leaf.html#ga13fefd14706bd5d85346066660f3c9eb">LEAF_init</a>(&amp;leaf, 44100, 128, mempool, 1000, &amp;exampleRandom);</div>
<div class="line">    </div>
<div class="line">    <a name="a2"></a><a class="code" href="group__tcycle.html#ga3ae2b653f390bdacdfe952e22a7aa5c4">tCycle_init</a>(&amp;cycle, &amp;leaf);</div>
<div class="line">    <a name="a3"></a><a class="code" href="group__tcycle.html#ga7eeb58e2292483416474bf83bf313deb">tCycle_setFreq</a>(&amp;cycle, 220);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> exampleFrame()</div>
<div class="line">{</div>
<div class="line">    </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> exampleTick(<span class="keywordtype">float</span> sampleIn)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">float</span> sampleOut = <a name="a4"></a><a class="code" href="group__tcycle.html#ga4fd599981f6caf87720db3a9811716cf">tCycle_tick</a>(&amp;cycle);</div>
<div class="line">    <span class="keywordflow">return</span> sampleOut;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> exampleRandom()</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">return</span> ((<span class="keywordtype">float</span>)rand()/(<span class="keywordtype">float</span>)(RAND_MAX));</div>
<div class="line">}</div>
<div class="line"> </div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="agroup__tcycle_html_ga3ae2b653f390bdacdfe952e22a7aa5c4"><div class="ttname"><a href="group__tcycle.html#ga3ae2b653f390bdacdfe952e22a7aa5c4">tCycle_init</a></div><div class="ttdeci">void tCycle_init(tCycle *const osc, LEAF *const leaf)</div><div class="ttdoc">Initialize a tCycle to the default mempool of a LEAF instance.</div><div class="ttdef"><b>Definition:</b> leaf-oscillators.c:391</div></div>
<div class="ttc" id="agroup__tcycle_html_ga7eeb58e2292483416474bf83bf313deb"><div class="ttname"><a href="group__tcycle.html#ga7eeb58e2292483416474bf83bf313deb">tCycle_setFreq</a></div><div class="ttdeci">void tCycle_setFreq(tCycle *const osc, float freq)</div><div class="ttdoc">Set the frequency of a tCycle oscillator.</div><div class="ttdef"><b>Definition:</b> leaf-oscillators.c:413</div></div>
<div class="ttc" id="agroup__tcycle_html_ga4fd599981f6caf87720db3a9811716cf"><div class="ttname"><a href="group__tcycle.html#ga4fd599981f6caf87720db3a9811716cf">tCycle_tick</a></div><div class="ttdeci">float tCycle_tick(tCycle *const osc)</div><div class="ttdoc">Tick a tCycle oscillator.</div><div class="ttdef"><b>Definition:</b> leaf-oscillators.c:427</div></div>
<div class="ttc" id="agroup__leaf_html_ga13fefd14706bd5d85346066660f3c9eb"><div class="ttname"><a href="group__leaf.html#ga13fefd14706bd5d85346066660f3c9eb">LEAF_init</a></div><div class="ttdeci">void LEAF_init(LEAF *const leaf, float sampleRate, int blockSize, char *memory, size_t memorySize, float(*random)(void))</div><div class="ttdoc">Initialize the LEAF instance.</div><div class="ttdef"><b>Definition:</b> leaf.c:21</div></div>
<div class="ttc" id="astruct_l_e_a_f_html"><div class="ttname"><a href="struct_l_e_a_f.html">LEAF</a></div><div class="ttdoc">Struct for an instance of LEAF.</div><div class="ttdef"><b>Definition:</b> leaf-global.h:31</div></div>
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
</body>
</html>
